# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

pkgname=publicsuffix-list
pkgver=20190607.806.6f03f42
pkgrel=1
pkgdesc='Cross-vendor public domain suffix database'
url='https://github.com/publicsuffix/list'
arch=('any')
license=('custom:MPL2')
makedepends=('git')
checkdepends=('libxslt-devel' 'python3' 'icu>=59.1')
source=(${pkgname}::"git+https://github.com/publicsuffix/list")
sha512sums=('SKIP')

pkgver() {
  cd ${pkgname}
  printf "%s.%s.%s" "$(date +%Y%m%d)" \
    "$(git rev-list --count HEAD)" \
    "$(git rev-parse --short HEAD)"
}

check() {
  cd ${pkgname}
  make test
}

package() {
  cd ${pkgname}
  install -Dm 644 public_suffix_list.dat tests/test_psl.txt -t "${pkgdir}/usr/share/publicsuffix"
  ln -s public_suffix_list.dat "${pkgdir}/usr/share/publicsuffix/effective_tld_names.dat"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
